resourceloader: Add test for getVersionHash parent-definition requirement
authorTimo Tijhof <krinklemail@gmail.com>
Tue, 26 Jun 2018 15:24:31 +0000 (16:24 +0100)
committerTimo Tijhof <krinklemail@gmail.com>
Tue, 26 Jun 2018 15:24:31 +0000 (16:24 +0100)
Change-Id: I69cdfea96c1e64bd8a7495eb6e56d0aefbe37643

tests/phpunit/includes/resourceloader/ResourceLoaderModuleTest.php

index 0ea4e2b..c925339 100644 (file)
@@ -64,6 +64,19 @@ class ResourceLoaderModuleTest extends ResourceLoaderTestCase {
                );
        }
 
+       /**
+        * @covers ResourceLoaderModule::getVersionHash
+        */
+       public function testGetVersionHash_parentDefinition() {
+               $context = $this->getResourceLoaderContext();
+               $module = $this->getMockBuilder( ResourceLoaderModule::class )
+                       ->setMethods( [ 'getDefinitionSummary' ] )->getMock();
+               $module->method( 'getDefinitionSummary' )->willReturn( [ 'a' => 'summary' ] );
+
+               $this->setExpectedException( LogicException::class, 'must call parent' );
+               $module->getVersionHash( $context );
+       }
+
        /**
         * @covers ResourceLoaderModule::validateScriptFile
         */